package com.ruoyi.web.task;

import com.ruoyi.system.service.SysOrgPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author hnb
 * @Date 2024/11/18
 * @Description
 **/
@Component
public class MyScheduledTask {
    @Autowired
    private SysOrgPersonService sysOrgPersonService;

    @Scheduled(cron = "0 0 0,12 * * ? ") //
    public void reportCurrentTime() {
        System.out.println("现在时间：" + System.currentTimeMillis());
        try {
            sysOrgPersonService.updateJdPerson();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
}
